<style>
.canshu_2 ,.canshu{ margin-bottom:5px;}
.canshu_2 input,.canshu input{ margin-right:5px;}
.delgoods_spec,.canshu_2 .btn,.canshu .btn{ padding:0px;}
.btn_add{ margin-bottom:5px;}
</style>
<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
		<ul class="breadcrumb">
                    <li><a href="<{:U('index')}>">社区</a></li>
                    <li class="active">基本设置</li>
                </ul>
		</div>
		<div class="panel-body">
			     <form id="myform" enctype="multipart/form-data" method="post" action="<{:U('setting')}>">
                       
                     
                              
							 
							    <div class="vmall_cle">
                            <label for="input-title" class="vmall_te_le">发帖设置</label>
                            <div class="vmaal_rols" style="margin-top:7px;">
                            <input type="button"   value="添加" onclick="add_cs(this)" class="btn j_img_clear delgoods_spec btn_add">
                            <div id="cs">

                               <if condition="$topic_type">
                                   <volist name="topic_type" id="vo">
                                       <div class="canshu">
									   <input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.type}>" name="topic_type[<{$i}>][type]"><input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.model}>" name="topic_type[<{$i}>][model]"><input type="text" style="width:320px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.url}>" name="topic_type[<{$i}>][url]"><input type="button"   value="删除" onclick="del_cs(this)" class="btn j_img_clear delgoods_spec"></div>

                                   </volist>
                               </if>
                                
                            </div>    
                                

                            </div>
                        </div>
						<div class="vmall_cle">
                            <label for="input-title" class="vmall_te_le">回复设置</label>
                            <div class="vmaal_rols" style="margin-top:7px;">
                            <input type="button"   value="添加" onclick="add_cs_2(this)" class="btn j_img_clear delgoods_spec btn_add">
                            <div id="cs_2">

                                <if condition="$comment_type">
                                   <volist name="comment_type" id="vo">
                                       <div class="canshu_2">
									   <input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.type}>" name="comment_type[<{$i}>][type]"><input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.model}>" name="comment_type[<{$i}>][model]"><input type="text" style="width:320px;" class="vmaal_sinw1 input_a1 int_wod" value="<{$vo.url}>" name="comment_type[<{$i}>][url]>"><input type="button"   value="删除" onclick="del_cs_2(this)" class="btn j_img_clear delgoods_spec"></div>

                                   </volist>
                               </if>
                                
                            </div>    
                                

                            </div>
                        </div>
							 
    
                             <div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>

                          
                     </form>
		</div>
	</div>
</div>

 
  <script>
var canshu=$(".canshu").length;
var canshu_2=$(".canshu_2").length;
 function add_cs(o){
 canshu++;
         $('<div class="canshu"><input placeholder="帖子类型group" type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod"  name="topic_type['+canshu+'][type]"><input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" placeholder="帖子对应的model，如：SnsGroup" name="topic_type['+canshu+'][model]"><input type="text" style="width:320px;" class="vmaal_sinw1 input_a1 int_wod" placeholder="发帖时@功能要用到这个url" name="topic_type['+canshu+'][url]"><input type="button"   value="删除" onclick="del_cs(this)" class="btn j_img_clear delgoods_spec"></div>').appendTo($("#cs"));
     }
     function del_cs(o){
	  	canshu--;
        $(o).parents('.canshu').remove();
     }
	 
 function add_cs_2(o){
 canshu_2++;
        $('<div class="canshu_2"><input placeholder="type" type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod"  name="comment_type['+canshu_2+'][type]"><input type="text" style="width:120px;" class="vmaal_sinw1 input_a1 int_wod" placeholder="model" name="comment_type['+canshu_2+'][model]"><input type="text" style="width:320px;" class="vmaal_sinw1 input_a1 int_wod" placeholder="回复提醒时的url" name="comment_type['+canshu_2+'][url]"><input type="button"   value="删除" onclick="del_cs_2(this)" class="btn j_img_clear delgoods_spec"></div>').appendTo($("#cs_2"));
     }
     function del_cs_2(o){
	  	canshu_2--;
        $(o).parents('.canshu_2').remove();
     }	 
</script>

 